package ModelLayer;
import java.util.ArrayList;

/**
 * Write a description of class Item here.
 * 
 * @author (Ulrik) 
 * @version (28052013)
 */
public class Item
{
    // instance variables - 
    private int id;
    private String name;
    private double salesPrice;
    private String defaultColli;
    private ArrayList<Subset> itemSubset;

    /**
     * Constructor for Item.
     * @param Int id, String name, double salesPrice
     */

    public Item(int id, String name, double salesPrice, String defaultColli)
    {
        this.id = id;
        this.name = name;
        this.salesPrice = salesPrice;
        this.defaultColli = defaultColli;
        itemSubset = new ArrayList<Subset>();
    }
    
    public Subset addSubset(int quantity, int max, int min, Location loc)
    {
    	Subset s = new Subset(quantity, max, min, this, loc);
        itemSubset.add(s);
        return s;
    }
    
    public ArrayList<Subset> getAllSubsets()
    {
        return itemSubset;
    }
    
    public int getId()
    {
        return id;
    }

	public String getName() {
		return name;
	}

	public double getSalesPrice() {
		return salesPrice;
	}

	public String getDefaultColli() {
		return defaultColli;
	}

	public ArrayList<Subset> getItemSubset() {
		return itemSubset;
	}
}

